home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / asm32.zip / E32.ZIP / SCRNDATA.ASM < prev    next >
Assembly Source File  |  1996-01-18  |  2KB  |  75 lines

  1. ; SCRNDATA.ASM for E32 - Copyright (C) 1994 Douglas Herr
  2. ;  all rights reserved
  3.  
  4. include    model.inc
  5.  
  6. public    get_screen_data
  7. extrn    crtinfo:near
  8. extrn    getcrt:near
  9. extrn    swap_files:near
  10. extrn    mouse_init:near
  11.  
  12. include    dataseg.inc
  13.  
  14. extrn    columns:byte, normal:byte, dirty_bits:byte
  15. extrn    inverse:byte, warning:byte, window_row:byte
  16. extrn    rows:word, saved_pos:word, screen_addr:dword
  17. extrn    default_normal:byte
  18.  
  19. @curseg    ends
  20.  
  21. include    codeseg.inc
  22. get_screen_data    proc    near
  23.     lea    edi,normal
  24.     lea    esi,default_normal
  25.     push    ds
  26.     pop    es
  27.     mov    ecx,3
  28.     rep    movsb            ; assume color screen for now
  29.  
  30.     xor    ah,ah
  31.     call    crtinfo
  32.     mov    screen_addr,ebx
  33.     dec    eax
  34.     dec    eax            ; allow space for fkey prompts
  35.     mov    byte ptr columns,ch
  36.     cmp    ch,60            ; allow one more space if 40 columns
  37.     sbb    eax,0
  38.     mov    rows,ax
  39.     or    dirty_bits,00100001b    ; flag for screen update
  40.  
  41. ; check for monochrome screen
  42.     push    eax            ; save rows in AL
  43.     call    getcrt
  44.     cmp    ax,0FFFFh        ; CGA?
  45.     je    short screen_data1    ;  yup, keep color attribute
  46.     cmp    ax,0            ; MDA?
  47.     je    short screen_data0    ;  yup, use monochrome attribute
  48.     cmp    ax,208            ; InColor?
  49.     je    short screen_data1    ;  yup, keep color
  50.     cmp    ax,128            ; Hercules?
  51.     jb    short screen_data1    ;  no, must be color
  52. screen_data0:
  53.     mov    normal,07h
  54. screen_data1:
  55.     pop    eax            ; AL = rows
  56.     mov    saved_pos,-1
  57.     call    mouse_init
  58.     cmp    window_row,1
  59.     je    short screen_data_exit
  60.     mov    ax,rows
  61.     inc    al
  62.     shr    al,1
  63.     mov    window_row,al
  64.     call    screen_data2
  65. screen_data2:
  66.     mov    bx,1
  67.     call    swap_files
  68. screen_data_exit:
  69.     ret
  70.  
  71. get_screen_data    endp
  72.  
  73. @curseg    ends
  74.     end
  75.